#include "stdafx.h"
#if (WINVER >=_WIN32_WINNT_WIN8)


#include "qbarrier.h"
using namespace micro::core;


// #define SYNCHRONIZATION_BARRIER_FLAGS_SPIN_ONLY  0x01
// #define SYNCHRONIZATION_BARRIER_FLAGS_BLOCK_ONLY 0x02
// #define SYNCHRONIZATION_BARRIER_FLAGS_NO_DELETE  0x04
// 

QBarrier::QBarrier()
{

}

QBarrier::~QBarrier()
{

}

bool QBarrier::Init( int nrThreads, int nrSpin )
{
   return (bool) ::InitializeSynchronizationBarrier( &m_barrier, nrThreads, nrSpin );
}

bool QBarrier::Enter( DWORD dwFlags )
{
	return (bool) ::EnterSynchronizationBarrier(&m_barrier, dwFlags);
}

bool QBarrier::Delete()
{
	return (bool) ::DeleteSynchronizationBarrier(&m_barrier);
}

#endif



